package day05;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;

public class ArrayDemo {
    public static void main(String[] args) {
        int[] arr = new int[10];
        for (int i = 0; i < arr.length; i++) {
            arr[i] = (int)(Math.random()*100);
            System.out.println(arr[i]);
        }
        Arrays.sort(arr);
        System.out.println("排序后");
        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i]);
        }
        System.out.println("倒着输出");
        for (int i = arr.length-1;i>=0; i--) {
            System.out.println(arr[i]);
        }
















        /*int[] arr = new int[100];
        for (int i = 0; i < arr.length; i++) {
            arr[i]=(int)(Math.random()*100);
            System.out.println(arr[i]);
        }*/










       /* int[] b = new int[3];
        int[] arr = new int[]{2,3,4,5};//动态
        int[] arr1 = {2,3,4,5};//静态
        int[] arr2 ;
        arr2 = new int[]{2,3,4,5};
        int[] arr3 = new int[3];
        System.out.println("数组的长度"+arr3.length);
        System.out.println(arr3[0]);
        arr3[0] = 100;
        arr3[1] = 200;
        arr3[2] = 300;
        System.out.println(arr3[arr3.length-1]);*/


    }
}
